<?php
class CommonController extends Zend_Controller_Action
{
	public function indexAction()
	{
		exit;
	}
	
	public function downloadAction()
	{
		$sFile			= $this->_request->getParam('filename', null);
		$strPath		= $this->_request->getParam('p', null);
		if($sFile)
		{
			$sFileLink		= ROOT_SITE . '/data/' .  $sFile;
			if($strPath)
			{
				$sFileLink	= ROOT_SITE .'/'. $strPath .'/'.  $sFile;
			}
			header("Content-type: text/csv");
			header("Content-Disposition: attachmen;filename=$sFile"); 
			header("Content-Transfer-Encoding: binary"); 
			header('Pragma: no-cache');
			header('Expires: 0'); 
			set_time_limit(0); 
			readfile($sFileLink);  
		}
		exit;
	}
}
?>
